<?php
 
   $lot=$_GET["lot"];
   //$dbName = "sqlsrv:Server=172.31.3.9,1433;Database=UFDATA_001_2017";   //这里是服务器IP地址和数据库名，端口不是默认的话记得改一下
   $dbUser = "sa";    //用户名
   $dbPassword = "TDled2017";    //登陆密码
	$dbdata = array();
	$i=0;
		$dbName_2 = "sqlsrv:Server=172.31.3.9,1433;Database=UFDATA_001_2017";   //这里是服务器IP地址和数据库名，端口不是默认的话记得改一下
		$db_2 = new PDO($dbName_2, $dbUser, $dbPassword);   
		
		$sql="select ReelNo,verificationcode,derweima from [dbo].[ldx_SeoulLabels] where derweima='".$lot."' UNION select ReelNo,newrcode,Derweima  from ldx_SeoulNewLabels where Derweima='".$lot."'";
		$res = null;
		
		$res = $db_2->query($sql);
		$rdisk="";
		$row = null;
		while ($row = $res->fetch()){
		//$i+=1;
		$dbdata[0]=$row['verificationcode'];
		$dbdata[1]=$row['ReelNo'];
		
	}
	
	
	
	//Print array in JSON format
	echo json_encode($dbdata);
	
?>